package com.luych.toolbox.data.service.entity;

import com.luych.toolbox.common.enums.DataCompareHistoryStatus;
import com.luych.toolbox.common.service.base.BaseEntity;

import javax.persistence.*;
import java.util.Date;

@Entity
@Table(name = "data_compare_history")
public class DataCompareHistory extends BaseEntity {

    @Column(name = "data_source_one_id")
    private String dataSourceOneId;
    @Column(name = "data_source_two_id")
    private String dataSourceTwoId;
    @Column(name = "data_compare_plan_id")
    private String dataComparePlanId;
    @Column(name = "name")
    private String name;
    @Column(name = "status")
    @Enumerated(EnumType.STRING)
    private DataCompareHistoryStatus status;
    @Column(name = "error_message")
    private String errorMessage;
    @Column(name = "error_trace")
    private String errorTrace;
    @Column(name = "owner_id")
    private String ownerId;
    @Column(name = "start_date")
    private Date startDate;
    @Column(name = "complete_date")
    private Date completeDate;
    @Column(name = "one_to_two")
    private String oneToTwo;
    @Column(name = "two_to_one")
    private String twoToOne;
    @Column(name = "one_to_two_lower")
    private String oneToTwoLower;
    @Column(name = "two_to_one_lower")
    private String twoToOneLower;
    @Column(name = "one_to_two_upper")
    private String oneToTwoUpper;
    @Column(name = "two_to_one_upper")
    private String twoToOneUpper;

    public String getDataSourceOneId() {
        return dataSourceOneId;
    }

    public void setDataSourceOneId(String dataSourceOneId) {
        this.dataSourceOneId = dataSourceOneId;
    }

    public String getDataSourceTwoId() {
        return dataSourceTwoId;
    }

    public void setDataSourceTwoId(String dataSourceTwoId) {
        this.dataSourceTwoId = dataSourceTwoId;
    }

    public String getDataComparePlanId() {
        return dataComparePlanId;
    }

    public void setDataComparePlanId(String dataComparePlanId) {
        this.dataComparePlanId = dataComparePlanId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public DataCompareHistoryStatus getStatus() {
        return status;
    }

    public void setStatus(DataCompareHistoryStatus status) {
        this.status = status;
    }

    public String getErrorMessage() {
        return errorMessage;
    }

    public void setErrorMessage(String errorMessage) {
        this.errorMessage = errorMessage;
    }

    public String getErrorTrace() {
        return errorTrace;
    }

    public void setErrorTrace(String errorTrace) {
        this.errorTrace = errorTrace;
    }

    public String getOwnerId() {
        return ownerId;
    }

    public void setOwnerId(String ownerId) {
        this.ownerId = ownerId;
    }

    public Date getStartDate() {
        return startDate;
    }

    public void setStartDate(Date startDate) {
        this.startDate = startDate;
    }

    public Date getCompleteDate() {
        return completeDate;
    }

    public void setCompleteDate(Date completeDate) {
        this.completeDate = completeDate;
    }

    public String getOneToTwo() {
        return oneToTwo;
    }

    public void setOneToTwo(String oneToTwo) {
        this.oneToTwo = oneToTwo;
    }

    public String getTwoToOne() {
        return twoToOne;
    }

    public void setTwoToOne(String twoToOne) {
        this.twoToOne = twoToOne;
    }

    public String getOneToTwoLower() {
        return oneToTwoLower;
    }

    public void setOneToTwoLower(String oneToTwoLower) {
        this.oneToTwoLower = oneToTwoLower;
    }

    public String getTwoToOneLower() {
        return twoToOneLower;
    }

    public void setTwoToOneLower(String twoToOneLower) {
        this.twoToOneLower = twoToOneLower;
    }

    public String getOneToTwoUpper() {
        return oneToTwoUpper;
    }

    public void setOneToTwoUpper(String oneToTwoUpper) {
        this.oneToTwoUpper = oneToTwoUpper;
    }

    public String getTwoToOneUpper() {
        return twoToOneUpper;
    }

    public void setTwoToOneUpper(String twoToOneUpper) {
        this.twoToOneUpper = twoToOneUpper;
    }

    public void addOneToTwo(String oneToTwo) {
        if (this.oneToTwo == null) {
            this.oneToTwo = "";
        }
        this.oneToTwo += oneToTwo + "\n";
    }

    public void addTwoToOne(String twoToOne) {
        if (this.twoToOne == null) {
            this.twoToOne = "";
        }
        this.twoToOne += twoToOne + "\n";
    }

    public void addOneToTwoLower(String oneToTwoLower) {
        if (this.oneToTwoLower == null) {
            this.oneToTwoLower = "";
        }
        this.oneToTwoLower += oneToTwoLower + "\n";
    }

    public void addTwoToOneLower(String twoToOneLower) {
        if (this.twoToOneLower == null) {
            this.twoToOneLower = "";
        }
        this.twoToOneLower += twoToOneLower + "\n";
    }

    public void addOneToTwoUpper(String oneToTwoUpper) {
        if (this.oneToTwoUpper == null) {
            this.oneToTwoUpper = "";
        }
        this.oneToTwoUpper += oneToTwoUpper + "\n";
    }

    public void addTwoToOneUpper(String twoToOneUpper) {
        if (this.twoToOneUpper == null) {
            this.twoToOneUpper = "";
        }
        this.twoToOneUpper += twoToOneUpper + "\n";
    }
}